<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>

<body>
  <script src="./ThreeJs/WebGL.js"></script>
  <script src="./ThreeJs/js/three.js"></script>
  <script>
    var renderer = new THREE.WebGLRenderer();
    renderer.setSize(window.innerWidth, window.innerHeight);
    document.body.appendChild(renderer.domElement);

    var camera = new THREE.PerspectiveCamera(45, window.innerWidth / window.innerHeight, 1, 500);
    camera.position.set(0, 0, 100);
    camera.lookAt(0, 0, 0);

    var scene = new THREE.Scene();

    // 创建一个蓝色线条材质
    var material = new THREE.LineBasicMaterial({ color: 0x0000ff });
    // 绘制坐标
    var geometry = new THREE.Geometry();
    geometry.vertices.push(new THREE.Vector3(-10, 0, 0));
    geometry.vertices.push(new THREE.Vector3(0, 10, 0));
    geometry.vertices.push(new THREE.Vector3(10, 0, 0));
    // 将他们组合在一起，形成一条线。
    var line = new THREE.Line(geometry, material);

    scene.add(line);
    renderer.render(scene, camera);
  </script>
</body>

</html>